<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>canvas-2</title>
<style>
	body{
		text-align: center
	}	
	#c{
		border: 1px solid #000;
	}
</style>
</head>
<canvas id="c" width="800" height="600"></canvas>
<script>
	var ctx=c.getContext("2d");
	var x=0;
	setInterval(function(){
		ctx.textBaseline='top';
		ctx.font="32px sans-senif";
		ctx.fillText("跑马灯",x,0);
		ctx.clearRect(x-100,0,100,100)
		x+=100;
		if(x>=900){
			x=0;
		}
	},400);
</script>
<body>
</body>
</html>
